<?php

class Site_Models_Article extends Fengqiaoju_Db_Table {
	
	/**
	 * 文章内容表
	 */
	private $_table_content = "site_article_content";

	public function __construct() {

		parent::__construct ();
		$this->_name = $this->_prefix . "site_article";
		$this->_primary = "article_id";
		$this->_table_content = $this->_prefix . $this->_table_content;
	}

	/**
	 * 获取文章信息
	 */
	public function getArticleInfo($where) {

		$article = $this->fetchRow ( $where );
		if ($article) {
			$article = $article->toArray ();
		}
		
		//获取文章内容
		$sql = "select * from {$this->_table_content} WHERE article_id='{$article['article_id']}' ";
		$content = $this->_db->fetchRow ( $sql );
		$article ['article_content'] = $content ['article_content'];
		
		return $article;
	}
}
?>